cc.Class({
    extends: cc.Component,

    properties: {
        Gundong: {
            default: null,
            type: cc.Node
        },
        Gundong2: {
            default: null,
            type: cc.Node
        },
        Zhezhao: {
            default: null,
            type: cc.Node
        }
    },
    onLoad() {
        this.Gundong.x = this.Zhezhao.width;
        this.Gundong2.x = this.Gundong.x + this.Gundong.width + 100;
    },
    update(dt) {
        var text1=this.Gundong;
        var text2=this.Gundong2;
        var speed=2;
        text1.setPosition(text1.x-speed,text1.y);
        text2.setPosition(text2.x-speed,text2.y);
        if(text1.x<=-text1.width){
            text1.setPosition(text2.x+text2.width+100-speed,text1.y);
        }
        if(text2.x<=-text2.width){
            text2.setPosition(text1.x+text1.width+100-speed,text2.y);
        }
    }
});
